package com.syh.jn.scm.infrastructure.repository.model.system;

import com.syh.core.ddd.infrastructure.repository.model.SuperBusinessModel;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 账号管理
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Entity
@Table(name = "T_SYSTEM_ACCOUNT")
@EqualsAndHashCode(callSuper = true)
public class AccountModel extends SuperBusinessModel {
  /**
   * 登录账号
   */
  @Column(name = "LOGIN_ACCOUNT", columnDefinition = "varchar(50) COMMENT '登录账号'")
  private String loginAccount;
  /**
   * 登录密码
   */
  @Column(name = "LOGIN_PASSWORD", columnDefinition = "varchar(200) COMMENT '登录密码'")
  private String loginPassword;
  /**
   * 登录手机账号
   */
  @Column(name = "LOGIN_PHONE_ID", columnDefinition = "bigint COMMENT '登录手机账号ID'")
  private Long loginPhoneId;
  /**
   * 姓名
   */
  @Column(name = "NAME", columnDefinition = "varchar(50) COMMENT '姓名'")
  private String name;
  /**
   * 电话
   */
  @Column(name = "TELEPHONE", columnDefinition = "varchar(50) COMMENT '电话'")
  private String telephone;
  /**
   * 角色id
   */
  @Column(name = "ROLE_ID", columnDefinition = "bigint COMMENT '角色id'")
  private Long roleId;
	/**
	 * 使用情况
	 */
	@Column(name = "ENABLE", columnDefinition = "smallint COMMENT '使用情况: -1冻结, 1启用'")
  private Short enable;
  /**
   * 是否超管 1 是 -1 否
   */
  @Column(name = "ADMIN", columnDefinition = "smallint COMMENT '是否超管 1 是 -1 否'")
  private Short admin;
  /**
   * 创建时间
   */
  @Column(name="CREATE_TIME_STAMP" , columnDefinition=("bigint COMMENT '创建时间'"))
  private Long createTimeStamp;
  /**
   * 最后修改时间
   */
  @Column(name="LAST_UPDATE_TIME_STAMP" , columnDefinition=("bigint COMMENT '最后修改时间'"))
  private Long lastUpdateTimeStamp;
  /**
   *  所属终端系统:DOWNSTREAM,OPERATION,SUPPLIER,UPSTREAM
   */
  @Column(name = "TERMINAL_TYPE", columnDefinition = "varchar(50) COMMENT '所属终端'")
  private String terminalType;
}

